package com.xuexiang.xuidemo.adapter;

import androidx.annotation.NonNull;
import com.xuexiang.xui.adapter.recyclerview.BaseRecyclerAdapter;
import com.xuexiang.xui.adapter.recyclerview.RecyclerViewHolder;
import com.xuexiang.xui.utils.ResUtils;
import com.xuexiang.xuidemo.R;
import com.xuexiang.xuidemo.domain.Order;
import org.jetbrains.annotations.NotNull;

import java.util.Collection;

/**
 * 基于simple_list_item_2简单的适配器
 *
 * @author XUE
 * @since 2019/4/1 11:04
 */
public class SimpleOrderRecyclerAdapter extends BaseRecyclerAdapter<Order> {

    public SimpleOrderRecyclerAdapter() {
    }

    public SimpleOrderRecyclerAdapter(Collection<Order> list) {
        super(list);
    }

    @Override
    protected void bindData(@NonNull @NotNull RecyclerViewHolder holder, int position, Order item) {
        String yi = item.getDjbh().trim() + " " + item.getDwmch().trim() + " " + item.getRq()+" "+item.getOntime();
        String er = item.getSpmch().trim() + "/" + item.getShpgg().trim() + "/" + item.getShengccj().trim()+ "/" + item.getPihao().trim();
        holder.text(android.R.id.text1, yi);
        holder.text(android.R.id.text2, er);
        holder.textColorId(android.R.id.text2, R.color.xui_config_color_light_blue_gray);
    }

    @Override
    protected int getItemLayoutId(int viewType) {
        return android.R.layout.simple_list_item_2;
    }

}
